import React, {Component, Fragment} from 'react';

class Point extends Component {

    render() {
        const {type, visible, img, title, displayStyle} = this.props;
        let src = "/images/ecology8/statusicon/BDNew_wev8.png";
        if (type == 'green') {
            src = "/images/ecology8/statusicon/BDNew2_wev8.png";
        } else if (type == 'purple') {
            src = "/images/ecology8/statusicon/BDOut_wev8.png";
        }
        var pointStyle = {padding: "0 5px", ...displayStyle};
        if (!visible) {
            pointStyle = {display: 'none'};
        }
        return (
            <span style={pointStyle}>
            {visible ? <img src={src} title={title}/> : ""}
            </span>
        )
    }

}

export default Point;